php replace every occurrence of character in string

89

replace all occurrence char in string php -

$string = str_replace('search','replace',$string);

php str replace -

<?php
$string = str_ireplace("FoX", "CAT", "the quick brown fox jumps over the lazy dog");
echo $string; // the quick brown CAT jumps over the lazy dog
?>

Comments

Submit
0 Comments